package com.details.app.Controller;

import com.details.app.Service.ReviewService;
import com.tamll.Type.DataType;
import com.tamll.bean.Review;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReviewController {

    @Autowired
    private ReviewService reviewService;


    @GetMapping("commentList")
    public DataType commentList(Integer productId){
        DataType dataType=new DataType();
        List<Review> reviews = reviewService.selectReviewProductId(productId);
        dataType.setReviewList(reviews);
        return dataType;
    }


}
